package com.yonyou.pmclouds.organization.entity;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 组织
 */
@Data
@Table(name = "pm_organization")
public class OrganizationVO extends SuperVO{
    public static final String SNAME = "sname";
    public static final String SCODE = "scode";
    public static final String PK_FINANCE_ORG = "pkFinanceOrg";
    public static final String PK_PARENT = "pkParent";
    public static final String START_DATE = "startDate";
    public static final String END_DATE = "endDate";
    public static final String ENABLE_STATE = "enableState";

    @Id
    private String pkOrganization;

    private String pkSrc;            //来源主键(NC)
    private String pkFinanceOrg;     //财务组织
    private String pkGroup;          //集团
    private String pkParent;         //父组织
    private String pkTenant;

    @Size(max = 20)
    private String scode;          //编码
    @Size(max = 50)
    private String sname;          //名称
    private String innerCode;      //内码
    private Boolean isLastVersion; //最新版本
    private Integer enableState;      //启用状态
    private Date startDate;        //开始日期
    private Date endDate;         //结束日期


    private String creator;
    private Date creationtime;
    private String modifier;
    private Date modifytime;

    @Transient
    private OrganizationVO[] children;
    @Transient
    private Boolean isDistributed;  //是否已分配给当前Role
    @Transient
    private String tenantName;
    @Transient
    private String tenantCode;
}
